using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
using Eamon.MeituanDotnetSDK.api.common.request;
using Eamon.MeituanDotnetSDK.attribute;

namespace Eamon.MeituanDotnetSDK.model.ddzh.tuangou.tuangouReceiptReverseconsume
{
    /// <summary>
    /// 撤销验券
    /// 注意，仅支持团购撤销；不支持次卡（平台次卡）和拼团；只可撤销当天核销且未超过10分钟的团购券。
    /// https://developer.meituan.com/docs/api/ddzh-tuangou-receipt-reverseconsume
    /// </summary>
    [ApiMeta(
        Path = "/ddzh/tuangou/receipt/reverseconsume",
        BusinessId = 58,
        ApiVersion = "10021",
        ApiName = "tuangou_receipt_reverseconsume",
        NeedAuth = true
    )]
    public class TuangouReceiptReverseconsumeRequest : MeituanRequest<TuangouReceiptReverseconsumeResponse>
    {
        /// <summary>
        /// 商家在自研系统或第三方服务商系统内登录的帐号，仅用于记录验券者的信息，该字段不参与任何验券校验逻辑
        /// </summary>
        [Required(ErrorMessage = "appShopAccount不能为空")]
        [JsonPropertyName("appShopAccount")]
        public string AppShopAccount { get; set; }

        /// <summary>
        /// 商家在自研系统或第三方服务商系统内登陆的用户名，仅用于记录验券者的信息，该字段不参与任何验券校验逻辑
        /// </summary>
        [Required(ErrorMessage = "appShopAccountName不能为空")]
        [JsonPropertyName("appShopAccountName")]
        public string AppShopAccountName { get; set; }

        /// <summary>
        /// 团购券码
        /// </summary>
        [Required(ErrorMessage = "receiptCode不能为空")]
        [JsonPropertyName("receiptCode")]
        public string ReceiptCode { get; set; }

        /// <summary>
        /// 套餐ID
        /// </summary>
        [Required(ErrorMessage = "dealId不能为空")]
        [JsonPropertyName("dealId")]
        public string DealId { get; set; }

        public override string ToString()
        {
            return $"TuangouReceiptReverseconsumeRequest{{AppShopAccount={AppShopAccount}, AppShopAccountName={AppShopAccountName}, ReceiptCode={ReceiptCode}, DealId={DealId}}}";
        }
    }
}
